package top.lishuoboy.boot02yaml.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lishuoboy.boot02yaml.config.ConfigProp;
import top.lishuoboy.boot02yaml.config.ConfigYaml;
import top.lishuoboy.dependency.base.json.HuJsonUtil;

/**
 * @author lishuoboy
 * @date 2022/1/19 19:17
 */
@Slf4j
@RestController
public class YamlController {
    @Autowired
    private ConfigYaml configYaml;
    @Autowired
    private ConfigProp configProp;

    @RequestMapping("/configYaml")
    private ConfigYaml configYaml() {
        log.debug("configYaml=={} ", configYaml);
        log.debug("configYaml=={} ", HuJsonUtil.toJsonPrettyStr(configYaml));
        return configYaml;
    }

    @RequestMapping("/configProp")
    private ConfigProp configProp() {
        log.debug("configProp=={} ", configProp);
        log.debug("configProp=={} ", HuJsonUtil.toJsonPrettyStr(configProp));
        return configProp;
    }
}
